import Vue from 'vue'
import VueRouter from 'vue-router'
import main from '../views/main.vue';
import home from '../views/home.vue'
import assess from '../views/assess.vue'
import search from '../views/search.vue'
import test from '../views/test.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'main',
    component: main,
    redirect: '/home',  // 重定向
    children:[
      {
        path: 'home',
        name: 'home',
        component: home
      },
      {
        path: 'assess',
        name: 'assess',
        component: assess
      },
      {
        path: 'search',
        name: 'search',
        component: search
      }
    ]
  },
  {
    path: '/test',
    name: 'test',
    component:test
  }

  
]

const router = new VueRouter({
  // mode: 'history',
  // base: process.env.BASE_URL,
  routes
})

export default router
